package com.fulin.desginpatten.command;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 命令模式
 * @Author fulin16
 * @Date 2020/12/10 16:30
 **/
public class Client {
    public static void main(String[] args) throws InterruptedException {
        Order order1 = new Order();
        order1.setTable(1);
        Map<String,Integer> foods = new HashMap<>();
        foods.put("土豆丝",1);
        foods.put("西红柿炒蛋",2);
        order1.setFoods(foods);

        Order order2 = new Order();
        order2.setTable(2);
        Map<String,Integer> foods2 = new HashMap<>();
        foods2.put("炒牛肉",1);
        foods2.put("皮蛋",1);
        order2.setFoods(foods2);

        SeniorChef chef = new SeniorChef();
        Command cmd1 = new OrderCommand(chef,order1);
        Command cmd2 = new OrderCommand(chef,order2);

        Waitor invoker = new Waitor();
        invoker.setCommand(cmd1);
        invoker.setCommand(cmd2);

        invoker.orderUp();

    }
}
